#!/usr/etc/env python
#_*_ coding : utf-8 _*_
'''
    TODO
'''
from contextlib import closing
import sqlite3
    
def init_db(app):
    with closing(connect_db(app)) as db :
        with app.open_resource('../schema.sql', mode = 'r') as f:
            db.cursor().executescript(f.read())
            db.commit()

def connect_db(app):
        return sqlite3.connect(app.config['DATABASE'])

    



